<!--管理员登陆 -->

<%@page pageEncoding="UTF-8"%>

<%
	request.setCharacterEncoding("UTF-8");
	String userName = "";
	String action = request.getParameter("action");
	if(action != null && action.trim().equals("login")) {
		userName = request.getParameter("userName");
		String password = request.getParameter("password");
		if((userName != null && userName.trim().equals("admin")) 
			&& (password != null && password.trim().equals("admin"))) {
				session.setAttribute("adminLogined", "true");
				response.sendRedirect("article_flat.jsp");
				
			} else {
				out.println("用户名或密码错误！");
			}
	}
%>


<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>管理员登陆</title>
</head>

<body>
	<form id="form1" name="form1" action="login.jsp" method="post">
		<input type="hidden" name="action" value="login">
		<p>
			<label for="userName">用户名:</label> <input type="text" name="userName"
				id="textfield" value=<%=userName %>>
		</p>
		<p>
			<label for="password">密码:</label> <input type="password"
				name="password" id="password"><br />
		</p>
		<input type="submit" name="submit" id="submit" value="登陆">
	</form>
</body>
</html>
